home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 60.zip / BS1 part 60 / Imagemaster d5.adf / piarc.lzh.parta / harlview.rexx < prev    next >
OS/2 REXX Batch file  |  1993-03-22  |  3KB  |  89 lines

  1. /*
  2.  * HARLVIEW.rexx
  3.  *
  4.  *  Written by: Barry Chalmers
  5.  * Last Update: May 6th, 1992
  6.  *         For: Black Belt Systems image processing series IM, IM F/c, and IP.
  7.  * ---------------------------------------------------------------------------
  8.  *    Revision: 1.00 - Initial release. Requires IM 9.11 or later.
  9.  */
  10. parse arg jackin dx1 dy1 dx2 dy2
  11. call pragma('stack',20000);
  12.  
  13. /*
  14.  * Default display modes   - These need to be set to correct values
  15.  *                           corresponding to your HARLEQUIN
  16.  *                           display setup.
  17.  *                           (The PAL/NTSC is learned by asking IM.)
  18.  */
  19.     mode     = 0;  /* 0 is    740x576 (PAL) or    740x486 (NTSC)          */
  20.                    /* 1 is    832x576 (PAL) or    832x486 (NTSC)          */
  21.                    /* 2 is    910x576 (PAL) or    910x486 (NTSC)          */
  22.     lace     = 0;  /* 0 for NON-interlace     1 for Interlace             */
  23.  
  24.  
  25. if jackin = 'finish' then do
  26.   exit 0;
  27.   end;
  28.  
  29. /*
  30.  * open rexxsupport.library -- needed for some functions
  31.  */
  32. if ~show('L',"rexxsupport.library") then do
  33.   if addlib('rexxsupport.library',0,-30,0) then do
  34.       /* everything's ok */
  35.     end;
  36.   else do
  37.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  38.     say 'Cannot operate script without this library - sorry!';
  39.     exit 10;
  40.     end;
  41.   end;
  42.  
  43. prtnme = 'IM_Port';
  44.  
  45.   /*
  46.    * This code attempts to read a file called "picmdpath" from REXX:
  47.    * If it can't find it, the script will assume that the commands
  48.    * associated with this PI Module are in "c:". If the file exists,
  49.    * the script will look in the path that is specified in the file.
  50.    * If you create this file, you MUST put a complete, correct path
  51.    * in it; if the commands are in a sub-directory, you have to put
  52.    * the trailing slash on the path (like, device:dir/).
  53.    * 
  54.    */
  55.   cmdpath = 'c:';
  56.   if open(fhandle,'rexx:picmdpath','read') then  /* open the file */
  57.     do
  58.       cmdpath = readln(fhandle);
  59.       call close(fhandle);  /* close the file    */
  60.     end
  61.  
  62. address(prtnme);
  63.  
  64. palntsc  = 1;  /* 0 for PAL   1 for NTSC                              */
  65. options results;
  66. 'pal';
  67. pal = result;
  68. options;
  69. if pal > 0 then palntsc = 0;
  70.  
  71. if jackin <= 0 then do
  72.   options results;
  73.   'jackin';
  74.   jackin = result;
  75.   options;
  76.   dx1 = -1;
  77.   dy1 = -1;
  78.   dx2 = -1;
  79.   dy2 = -1;
  80. end;
  81.  
  82. address command cmdpath||'harlview '||jackin||' '||dx1||' '||dy1||' '||dx2||' '||dy2||' '||palntsc||' '||mode||' '||lace;
  83. address(prtnme);
  84.  
  85. 'finish';
  86. address;
  87.  
  88. exit 0;
  89.